]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Port everything to class framework
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 20 Nov 2011 17:56:27 +0000 (18:56 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 24 Nov 2011 08:50:04 +0000 (09:50 +0100)
The last patch in the sequence. Every place that was previously
setting prototype has been ported to Lang.Class, to make code more
concise and allow for better toString().

https://bugzilla.gnome.org/show_bug.cgi?id=664436

48 files changed:
js/gdm/loginDialog.js
js/misc/docInfo.js
js/misc/history.js
js/misc/modemManager.js
js/ui/altTab.js
js/ui/appDisplay.js
js/ui/appFavorites.js
js/ui/automountManager.js
js/ui/autorunManager.js
js/ui/boxpointer.js
js/ui/calendar.js
js/ui/contactDisplay.js
js/ui/ctrlAltTab.js
js/ui/dash.js
js/ui/dnd.js
js/ui/endSessionDialog.js
js/ui/iconGrid.js
js/ui/keyboard.js
js/ui/layout.js
js/ui/lightbox.js
js/ui/lookingGlass.js
js/ui/magnifier.js
js/ui/magnifierDBus.js
js/ui/messageTray.js
js/ui/networkAgent.js
js/ui/notificationDaemon.js
js/ui/overview.js
js/ui/panel.js
js/ui/placeDisplay.js
js/ui/polkitAuthenticationAgent.js
js/ui/popupMenu.js
js/ui/runDialog.js
js/ui/search.js
js/ui/searchDisplay.js
js/ui/shellDBus.js
js/ui/shellMountOperation.js
js/ui/status/bluetooth.js
js/ui/statusIconDispatcher.js
js/ui/telepathyClient.js
js/ui/tweener.js
js/ui/viewSelector.js
js/ui/windowAttentionHandler.js
js/ui/windowManager.js
js/ui/workspace.js
js/ui/workspaceSwitcherPopup.js
js/ui/workspaceThumbnail.js
js/ui/workspacesView.js
js/ui/xdndHandler.js

index 0113dc8c9bdfc2138c54443bd79970a01ce58e6a..3700f0c44d6158bfa7a6809d17ae8e6b2561472d 100644 (file)
@@ -140,11 +140,9 @@ function _smoothlyResizeActor(actor, width, height) {
     return hold;
 }
 
-function UserListItem(user, reason) {
-    this._init(user, reason);
-}
+const UserListItem = new Lang.Class({
+    Name: 'UserListItem',
 
-UserListItem.prototype = {
     _init: function(user) {
         this.user = user;
         this._userChangedId = this.user.connect('changed',
@@ -273,15 +271,12 @@ UserListItem.prototype = {
                          });
         return hold;
     }
-
-};
+});
 Signals.addSignalMethods(UserListItem.prototype);
 
-function UserList() {
-    this._init.apply(this, arguments);
-}
+const UserList = new Lang.Class({
+    Name: 'UserList',
 
-UserList.prototype = {
     _init: function() {
         this.actor = new St.ScrollView({ style_class: 'login-dialog-user-list-view'});
         this.actor.set_policy(Gtk.PolicyType.NEVER,
@@ -537,14 +532,12 @@ UserList.prototype = {
         item.actor.destroy();
         delete this._items[userName];
     }
-};
+});
 Signals.addSignalMethods(UserList.prototype);
 
-function SessionListItem(id, name) {
-    this._init(id, name);
-}
+const SessionListItem = new Lang.Class({
+    Name: 'SessionListItem',
 
-SessionListItem.prototype = {
     _init: function(id, name) {
         this.id = id;
 
@@ -599,14 +592,12 @@ SessionListItem.prototype = {
     _onClicked: function() {
         this.emit('activate');
     }
-};
+});
 Signals.addSignalMethods(SessionListItem.prototype);
 
-function SessionList() {
-    this._init();
-}
+const SessionList = new Lang.Class({
+    Name: 'SessionList',
 
-SessionList.prototype = {
     _init: function() {
         this.actor = new St.Bin();
 
@@ -737,18 +728,9 @@ SessionList.prototype = {
                          }));
         }
     }
-};
+});
 Signals.addSignalMethods(SessionList.prototype);
 
-function LoginDialog() {
-    if (_loginDialog == null) {
-        this._init();
-        _loginDialog = this;
-    }
-
-    return _loginDialog;
-}
-
 const LoginDialog = new Lang.Class({
     Name: 'LoginDialog',
     Extends: ModalDialog.ModalDialog,
index d4499a0a4db3befb8707c9a9562a29e8c64ff94a..1c7db19fe1fcf95e74c9a600dee3441248771fed 100644 (file)
@@ -8,11 +8,9 @@ const Search = imports.ui.search;
 
 const THUMBNAIL_ICON_MARGIN = 2;
 
-function DocInfo(recentInfo) {
-    this._init(recentInfo);
-}
+const DocInfo = new Lang.Class({
+    Name: 'DocInfo',
 
-DocInfo.prototype = {
     _init : function(recentInfo) {
         this.recentInfo = recentInfo;
         // We actually used get_modified() instead of get_visited()
@@ -49,7 +47,7 @@ DocInfo.prototype = {
         }
         return mtype;
     }
-};
+});
 
 var docManagerInstance = null;
 
@@ -62,11 +60,9 @@ function getDocManager() {
 /**
  * DocManager wraps the DocSystem, primarily to expose DocInfo objects.
  */
-function DocManager() {
-    this._init();
-}
+const DocManager = new Lang.Class({
+    Name: 'DocManager',
 
-DocManager.prototype = {
     _init: function() {
         this._docSystem = Shell.DocSystem.get_default();
         this._infosByTimestamp = [];
@@ -135,6 +131,6 @@ DocManager.prototype = {
                 return this._infosByUri[url];
             })), terms);
     }
-};
+});
 
 Signals.addSignalMethods(DocManager.prototype);
index 2c127c3a7933ea4f2a8673f47776c8d958c567fa..5cb82823ab6cc512242fb936636e187eae979c63 100644 (file)
@@ -7,11 +7,9 @@ const Params = imports.misc.params;
 
 const DEFAULT_LIMIT = 512;
 
-function HistoryManager(params) {
-    this._init(params);
-}
+const HistoryManager = new Lang.Class({
+    Name: 'HistoryManager',
 
-HistoryManager.prototype = {
     _init: function(params) {
         params = Params.parse(params, { gsettingsKey: null,
                                         limit: DEFAULT_LIMIT,
@@ -111,5 +109,5 @@ HistoryManager.prototype = {
         if (this._key)
             global.settings.set_strv(this._key, this._history);
     }
-};
+});
 Signals.addSignalMethods(HistoryManager.prototype);
index d04a3ab65009de0afcbc7b14c2268590e0820fb1..e5f07c714122c9151e3a273d0542127bcbe67ffd 100644 (file)
@@ -54,11 +54,9 @@ function _getProvidersTable() {
     return _providersTable = providers;
 }
 
-function ModemGsm() {
-    this._init.apply(this, arguments);
-}
+const ModemGsm = new Lang.Class({
+    Name: 'ModemGsm',
 
-ModemGsm.prototype = {
     _init: function(path) {
         this._proxy = new ModemGsmNetworkProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
 
@@ -156,14 +154,12 @@ ModemGsm.prototype = {
 
         return name3 || name2 || null;
     }
-}
+});
 Signals.addSignalMethods(ModemGsm.prototype);
 
-function ModemCdma() {
-    this._init.apply(this, arguments);
-}
+const ModemCdma = new Lang.Class({
+    Name: 'ModemCdma',
 
-ModemCdma.prototype = {
     _init: function(path) {
         this._proxy = new ModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
 
@@ -231,5 +227,5 @@ ModemCdma.prototype = {
 
         return null;
     }
-};
+});
 Signals.addSignalMethods(ModemCdma.prototype);
index 166ca365bf7f88c7e9b59de1ae1c83047cadfc10..85d47924f7258a2a9390d153101a126b4a3b7243 100644 (file)
@@ -43,11 +43,9 @@ function primaryModifier(mask) {
     return primary;
 }
 
-function AltTabPopup() {
-    this._init();
-}
+const AltTabPopup = new Lang.Class({
+    Name: 'AltTabPopup',
 
-AltTabPopup.prototype = {
     _init : function() {
         this.actor = new Shell.GenericContainer({ name: 'altTabPopup',
                                                   reactive: true,
@@ -540,7 +538,7 @@ AltTabPopup.prototype = {
                            onComplete: Lang.bind(this, function () { this.thumbnailsVisible = true; })
                          });
     }
-};
+});
 
 const SwitcherList = new Lang.Class({
     Name: 'SwitcherList',
@@ -853,11 +851,9 @@ const SwitcherList = new Lang.Class({
 
 Signals.addSignalMethods(SwitcherList.prototype);
 
-function AppIcon(app) {
-    this._init(app);
-}
+const AppIcon = new Lang.Class({
+    Name: 'AppIcon',
 
-AppIcon.prototype = {
     _init: function(app) {
         this.app = app;
         this.actor = new St.BoxLayout({ style_class: 'alt-tab-app',
@@ -875,7 +871,7 @@ AppIcon.prototype = {
         this._iconBin.set_size(size, size);
         this._iconBin.child = this.icon;
     }
-};
+});
 
 const AppSwitcher = new Lang.Class({
     Name: 'AppSwitcher',
index 4db20c411e7551c5a89d84556d1ae6949850dc65..6931780d18207c20c6183421e1ec622f976a3fdb 100644 (file)
@@ -26,11 +26,9 @@ const MAX_APPLICATION_WORK_MILLIS = 75;
 const MENU_POPUP_TIMEOUT = 600;
 const SCROLL_TIME = 0.1;
 
-function AlphabeticalView() {
-    this._init();
-}
+const AlphabeticalView = new Lang.Class({
+    Name: 'AlphabeticalView',
 
-AlphabeticalView.prototype = {
     _init: function() {
         this._grid = new IconGrid.IconGrid({ xAlign: St.Align.START });
         this._appSystem = Shell.AppSystem.get_default();
@@ -130,13 +128,11 @@ AlphabeticalView.prototype = {
             this._addApp(app);
          }
     }
-};
+});
 
-function ViewByCategories() {
-    this._init();
-}
+const ViewByCategories = new Lang.Class({
+    Name: 'ViewByCategories',
 
-ViewByCategories.prototype = {
     _init: function() {
         this._appSystem = Shell.AppSystem.get_default();
         this.actor = new St.BoxLayout({ style_class: 'all-app' });
@@ -281,16 +277,14 @@ ViewByCategories.prototype = {
                 this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
         }
     }
-};
+});
 
 /* This class represents a display containing a collection of application items.
  * The applications are sorted based on their name.
  */
-function AllAppDisplay() {
-    this._init();
-}
+const AllAppDisplay = new Lang.Class({
+    Name: 'AllAppDisplay',
 
-AllAppDisplay.prototype = {
     _init: function() {
         this._appSystem = Shell.AppSystem.get_default();
         this._appSystem.connect('installed-changed', Lang.bind(this, function() {
@@ -306,7 +300,7 @@ AllAppDisplay.prototype = {
     _redisplay: function() {
         this._appView.refresh();
     }
-};
+});
 
 const AppSearchProvider = new Lang.Class({
     Name: 'AppSearchProvider',
@@ -427,11 +421,9 @@ const AppIcon = new Lang.Class({
     }
 });
 
-function AppWellIcon(app, iconParams, onActivateOverride) {
-    this._init(app, iconParams, onActivateOverride);
-}
+const AppWellIcon = new Lang.Class({
+    Name: 'AppWellIcon',
 
-AppWellIcon.prototype = {
     _init : function(app, iconParams, onActivateOverride) {
         this.app = app;
         this.actor = new St.Button({ style_class: 'app-well-app',
@@ -611,7 +603,7 @@ AppWellIcon.prototype = {
     getDragActorSource: function() {
         return this.icon.icon;
     }
-};
+});
 Signals.addSignalMethods(AppWellIcon.prototype);
 
 const AppIconMenu = new Lang.Class({
index 5faca55956b13d5b4ce00e945ee18028cf063d70..21257bc2a98422d125792a3ef10af75007275c36 100644 (file)
@@ -6,11 +6,9 @@ const Signals = imports.signals;
 
 const Main = imports.ui.main;
 
-function AppFavorites() {
-    this._init();
-}
+const AppFavorites = new Lang.Class({
+    Name: 'AppFavorites',
 
-AppFavorites.prototype = {
     FAVORITE_APPS_KEY: 'favorite-apps',
 
     _init: function() {
@@ -122,7 +120,7 @@ AppFavorites.prototype = {
             this._addFavorite(appId, pos);
         }));
     }
-};
+});
 Signals.addSignalMethods(AppFavorites.prototype);
 
 var appFavoritesInstance = null;
index 456e0426940a3ff79543b4a1c9ec3d9b88594bee..ee3e857c9f21ea4c5abcaebf5820b628beaa0b1b 100644 (file)
@@ -64,11 +64,9 @@ function ConsoleKitManager() {
     return self;
 }
 
-function AutomountManager() {
-    this._init();
-}
+const AutomountManager = new Lang.Class({
+    Name: 'AutomountManager',
 
-AutomountManager.prototype = {
     _init: function() {
         this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
         this._volumeQueue = [];
@@ -268,4 +266,4 @@ AutomountManager.prototype = {
             return false;
         });
     }
-}
+});
index c4158941099987c391a71ff5365083ff465f6529..2649b5337fe8f1f162004f6d2f13d7d386c4e1d9 100644 (file)
@@ -75,11 +75,9 @@ function HotplugSniffer() {
                                    '/org/gnome/Shell/HotplugSniffer');
 }
 
-function ContentTypeDiscoverer(callback) {
-    this._init(callback);
-}
+const ContentTypeDiscoverer = new Lang.Class({
+    Name: 'ContentTypeDiscoverer',
 
-ContentTypeDiscoverer.prototype = {
     _init: function(callback) {
         this._callback = callback;
     },
@@ -136,13 +134,11 @@ ContentTypeDiscoverer.prototype = {
 
         this._callback(mount, apps, contentTypes);
     }
-}
+});
 
-function AutorunManager() {
-    this._init();
-}
+const AutorunManager = new Lang.Class({
+    Name: 'AutorunManager',
 
-AutorunManager.prototype = {
     _init: function() {
         this._volumeMonitor = Gio.VolumeMonitor.get();
 
@@ -259,7 +255,7 @@ AutorunManager.prototype = {
                 + ': ' + e.toString());
         }
     },
-}
+});
 
 const AutorunResidentSource = new Lang.Class({
     Name: 'AutorunResidentSource',
@@ -404,11 +400,9 @@ const AutorunResidentNotification = new Lang.Class({
     },
 });
 
-function AutorunTransientDispatcher() {
-    this._init();
-}
+const AutorunTransientDispatcher = new Lang.Class({
+    Name: 'AutorunTransientDispatcher',
 
-AutorunTransientDispatcher.prototype = {
     _init: function() {
         this._sources = [];
         this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
@@ -499,7 +493,7 @@ AutorunTransientDispatcher.prototype = {
         // destroy the notification source
         source.destroy();
     }
-}
+});
 
 const AutorunTransientSource = new Lang.Class({
     Name: 'AutorunTransientSource',
index 00da8a238a1e8555fd5f16b54b93a1af8c6a7472..8f93b0d8a9d0edc72f984f2803897a3e59207f9e 100644 (file)
@@ -21,11 +21,9 @@ const POPUP_ANIMATION_TIME = 0.15;
  * placed.  The arrow position may be controlled via setArrowOrigin().
  *
  */
-function BoxPointer(side, binProperties) {
-    this._init(side, binProperties);
-}
+const BoxPointer = new Lang.Class({
+    Name: 'BoxPointer',
 
-BoxPointer.prototype = {
     _init: function(arrowSide, binProperties) {
         this._arrowSide = arrowSide;
         this._arrowOrigin = 0;
@@ -452,4 +450,4 @@ BoxPointer.prototype = {
     get opacity() {
         return this.actor.opacity;
     }
-};
+});
index 98ae634e64bdec565a2c76014319e0fde19d28f4..0c33ed0a77f5497a5cb7d3564676b5b5c2ed1042 100644 (file)
@@ -155,28 +155,24 @@ function _getEventDayAbbreviation(dayNumber) {
 
 // Abstraction for an appointment/event in a calendar
 
-function CalendarEvent(date, end, summary, allDay) {
-    this._init(date, end, summary, allDay);
-}
+const CalendarEvent = new Lang.Class({
+    Name: 'CalendarEvent',
 
-CalendarEvent.prototype = {
     _init: function(date, end, summary, allDay) {
         this.date = date;
         this.end = end;
         this.summary = summary;
         this.allDay = allDay;
     }
-};
+});
 
 // Interface for appointments/events - e.g. the contents of a calendar
 //
 
 // First, an implementation with no events
-function EmptyEventSource() {
-    this._init();
-}
+const EmptyEventSource = new Lang.Class({
+    Name: 'EmptyEventSource',
 
-EmptyEventSource.prototype = {
     _init: function() {
     },
 
@@ -191,7 +187,7 @@ EmptyEventSource.prototype = {
     hasEvents: function(day) {
         return false;
     }
-};
+});
 Signals.addSignalMethods(EmptyEventSource.prototype);
 
 const CalendarServerIface = <interface name="org.gnome.Shell.CalendarServer">
@@ -219,11 +215,6 @@ function CalendarServer() {
     return self;
 }
 
-// an implementation that reads data from a session bus service
-function DBusEventSource() {
-    this._init();
-}
-
 function _datesEqual(a, b) {
     if (a < b)
         return false;
@@ -242,8 +233,10 @@ function _dateIntervalsOverlap(a0, a1, b0, b1)
         return true;
 }
 
+// an implementation that reads data from a session bus service
+const DBusEventSource = new Lang.Class({
+    Name: 'DBusEventSource',
 
-DBusEventSource.prototype = {
     _init: function() {
         this._resetCache();
 
@@ -344,17 +337,15 @@ DBusEventSource.prototype = {
 
         return true;
     }
-};
+});
 Signals.addSignalMethods(DBusEventSource.prototype);
 
 // Calendar:
 // @eventSource: is an object implementing the EventSource API, e.g. the
 // requestRange(), getEvents(), hasEvents() methods and the ::changed signal.
-function Calendar(eventSource) {
-    this._init(eventSource);
-}
+const Calendar = new Lang.Class({
+    Name: 'Calendar',
 
-Calendar.prototype = {
     _init: function(eventSource) {
         if (eventSource) {
             this._eventSource = eventSource;
@@ -620,15 +611,13 @@ Calendar.prototype = {
         if (this._eventSource)
             this._eventSource.requestRange(beginDate, iter, forceReload);
     }
-};
+});
 
 Signals.addSignalMethods(Calendar.prototype);
 
-function EventsList(eventSource) {
-    this._init(eventSource);
-}
+const EventsList = new Lang.Class({
+    Name: 'EventsList',
 
-EventsList.prototype = {
     _init: function(eventSource) {
         this.actor = new St.BoxLayout({ vertical: true, style_class: 'events-header-vbox'});
         this._date = new Date();
@@ -759,4 +748,4 @@ EventsList.prototype = {
             this._showOtherDay(this._date);
         }
     }
-};
+});
index fe34a5475d0fd7a9db1ba228971a883f14704f91..dae9002a3960bd05ba1d2a434c49366f63113a0d 100644 (file)
@@ -20,11 +20,9 @@ function launchContact(id) {
 
 
 /* This class represents a shown contact search result in the overview */
-function Contact(id) {
-    this._init(id);
-}
+const Contact = new Lang.Class({
+    Name: 'Contact',
 
-Contact.prototype = {
     _init: function(id) {
         this._contactSys = Shell.ContactSystem.get_default();
         this.individual = this._contactSys.get_individual(id);
@@ -131,7 +129,7 @@ Contact.prototype = {
             return tc.load_icon_name(null, 'avatar-default', St.IconType.FULLCOLOR, size);
         }
     },
-};
+});
 
 
 /* Searches for and returns contacts */
index 9340846fd5702ef8d155da29c672d4b79f811b37..67d08817e2bba231a3c6fd756034e63c1d366785 100644 (file)
@@ -22,11 +22,9 @@ const SortGroup = {
     BOTTOM: 2
 };
 
-function CtrlAltTabManager() {
-    this._init();
-}
+const CtrlAltTabManager = new Lang.Class({
+    Name: 'CtrlAltTabManager',
 
-CtrlAltTabManager.prototype = {
     _init: function() {
         this._items = [];
         this._focusManager = St.FocusManager.get_for_stage(global.stage);
@@ -134,17 +132,15 @@ CtrlAltTabManager.prototype = {
                                       }));
         }
     }
-};
+});
 
 function mod(a, b) {
     return (a + b) % b;
 }
 
-function CtrlAltTabPopup() {
-    this._init();
-}
+const CtrlAltTabPopup = new Lang.Class({
+    Name: 'CtrlAltTabPopup',
 
-CtrlAltTabPopup.prototype = {
     _init : function() {
         this.actor = new Shell.GenericContainer({ name: 'ctrlAltTabPopup',
                                                   reactive: true });
@@ -303,7 +299,7 @@ CtrlAltTabPopup.prototype = {
         this._selection = num;
         this._switcher.highlight(num);
     }
-};
+});
 
 const CtrlAltTabSwitcher = new Lang.Class({
     Name: 'CtrlAltTabSwitcher',
index 0ddec795ba3a7100e858b00349e176272ea6369a..97fa33acb7e096fc3681bf073d556d4904958c92 100644 (file)
@@ -226,11 +226,9 @@ const DragPlaceholderItem = new Lang.Class({
     }
 });
 
-function Dash() {
-    this._init();
-}
+const Dash = new Lang.Class({
+    Name: 'Dash',
 
-Dash.prototype = {
     _init : function() {
         this._maxHeight = -1;
         this.iconSize = 64;
@@ -752,6 +750,6 @@ Dash.prototype = {
 
         return true;
     }
-};
+});
 
 Signals.addSignalMethods(Dash.prototype);
index 3c762f2845f979864427df4c94f70a1857f4a680..cb8b91394fa89a86b74761d0b57f8e1e0565ffb6 100644 (file)
@@ -69,11 +69,9 @@ function removeDragMonitor(monitor) {
         }
 }
 
-function _Draggable(actor, params) {
-    this._init(actor, params);
-}
+const _Draggable = new Lang.Class({
+    Name: 'Draggable',
 
-_Draggable.prototype = {
     _init : function(actor, params) {
         params = Params.parse(params, { manualMode: false,
                                         restoreOnSuccess: false,
@@ -596,7 +594,7 @@ _Draggable.prototype = {
         this._dragActor = undefined;
         currentDraggable = null;
     }
-};
+});
 
 Signals.addSignalMethods(_Draggable.prototype);
 
index 947524a76cb13a0e5ea58c83bb1c7924003a43da..d21d155cb352d2db90d6743151d0e49f94dd36cb 100644 (file)
@@ -142,11 +142,9 @@ function findAppFromInhibitor(inhibitor) {
     return app;
 }
 
-function ListItem(app, reason) {
-    this._init(app, reason);
-}
+const ListItem = new Lang.Class({
+    Name: 'ListItem',
 
-ListItem.prototype = {
     _init: function(app, reason) {
         this._app = app;
         this._reason = reason;
@@ -192,7 +190,7 @@ ListItem.prototype = {
         this.emit('activate');
         this._app.activate();
     }
-};
+});
 Signals.addSignalMethods(ListItem.prototype);
 
 // The logout timer only shows updates every 10 seconds
index f266577c6d56b3739432834d5c57a838332ccca3..1b9c905126ba29c9bfa4e7458773b536b0a563f0 100644 (file)
@@ -149,11 +149,9 @@ const BaseIcon = new Lang.Class({
     }
 });
 
-function IconGrid(params) {
-    this._init(params);
-}
+const IconGrid = new Lang.Class({
+    Name: 'IconGrid',
 
-IconGrid.prototype = {
     _init: function(params) {
         params = Params.parse(params, { rowLimit: null,
                                         columnLimit: null,
@@ -322,4 +320,4 @@ IconGrid.prototype = {
     visibleItemsCount: function() {
         return this._grid.get_children().length - this._grid.get_n_skip_paint();
     }
-};
+});
index a427f17ba5b64e31d7d63fe04362cae5a929e008..c7f2b0ea112152b00fd5196de1f44e86b3423680 100644 (file)
@@ -61,11 +61,9 @@ const CaribouKeyboardIface = <interface name='org.gnome.Caribou.Keyboard'>
 <property name='Name' access='read' type='s' />
 </interface>;
 
-function Key() {
-    this._init.apply(this, arguments);
-}
+const Key = new Lang.Class({
+    Name: 'Key',
 
-Key.prototype = {
     _init : function(key) {
         this._key = key;
 
@@ -191,13 +189,12 @@ Key.prototype = {
             this._boxPointer.hide(true);
         }
     }
-};
+});
 
-function Keyboard() {
-    this._init.apply(this, arguments);
-}
+const Keyboard = new Lang.Class({
+    // HACK: we can't set Name, because it collides with Name dbus property
+    // Name: 'Keyboard',
 
-Keyboard.prototype = {
     _init: function () {
         this._impl = Gio.DBusExportedObject.wrapJSObject(CaribouKeyboardIface, this);
         this._impl.export(Gio.DBus.session, '/org/gnome/Caribou/Keyboard');
@@ -532,7 +529,7 @@ Keyboard.prototype = {
     get Name() {
         return 'gnome-shell';
     }
-};
+});
 
 const KeyboardSource = new Lang.Class({
     Name: 'KeyboardSource',
index e4fcb624724861024faa8209d19099ed9be77b6f..c99c94177cf1c8f83184e7eea5296e60b00ebc3c 100644 (file)
@@ -17,11 +17,9 @@ const HOT_CORNER_ACTIVATION_TIMEOUT = 0.5;
 const STARTUP_ANIMATION_TIME = 0.2;
 const KEYBOARD_ANIMATION_TIME = 0.5;
 
-function LayoutManager() {
-    this._init.apply(this, arguments);
-}
+const LayoutManager = new Lang.Class({
+    Name: 'LayoutManager',
 
-LayoutManager.prototype = {
     _init: function () {
         this._rtl = (St.Widget.get_default_direction() == St.TextDirection.RTL);
         this.monitors = [];
@@ -374,7 +372,7 @@ LayoutManager.prototype = {
     findMonitorForActor: function(actor) {
         return this._chrome.findMonitorForActor(actor);
     }
-};
+});
 Signals.addSignalMethods(LayoutManager.prototype);
 
 
@@ -382,11 +380,9 @@ Signals.addSignalMethods(LayoutManager.prototype);
 //
 // This class manages a "hot corner" that can toggle switching to
 // overview.
-function HotCorner() {
-    this._init();
-}
+const HotCorner = new Lang.Class({
+    Name: 'HotCorner',
 
-HotCorner.prototype = {
     _init : function() {
         // We use this flag to mark the case where the user has entered the
         // hot corner and has not left both the hot corner and a surrounding
@@ -548,7 +544,7 @@ HotCorner.prototype = {
             return true;
         return false;
     }
-};
+});
 
 
 // This manages the shell "chrome"; the UI that's visible in the
@@ -561,11 +557,9 @@ const defaultParams = {
     affectsInputRegion: true
 };
 
-function Chrome() {
-    this._init.apply(this, arguments);
-}
+const Chrome = new Lang.Class({
+    Name: 'Chrome',
 
-Chrome.prototype = {
     _init: function(layoutManager) {
         this._layoutManager = layoutManager;
 
@@ -981,4 +975,4 @@ Chrome.prototype = {
 
         return false;
     }
-};
+});
index 58bce89d487e485edf6a1c396c1a0ca09acc82ce..f8c84627f98faa73b4925b5dd27521d513a28f07 100644 (file)
@@ -30,11 +30,9 @@ const Tweener = imports.ui.tweener;
  * @container and will track any changes in its size. You can override
  * this by passing an explicit width and height in @params.
  */
-function Lightbox(container, params) {
-    this._init(container, params);
-}
+const Lightbox = new Lang.Class({
+    Name: 'Lightbox',
 
-Lightbox.prototype = {
     _init : function(container, params) {
         params = Params.parse(params, { inhibitEvents: false,
                                         width: null,
@@ -196,4 +194,4 @@ Lightbox.prototype = {
 
         this.highlight(null);
     }
-};
+});
index 109174d5c9f5d68f0501582b672aeacc8444dbf6..c7fb4c344ed7f805123657907c3d19f5cd9bcf68 100644 (file)
@@ -55,11 +55,9 @@ function _getAutoCompleteGlobalKeywords() {
     return keywords.concat(windowProperties).concat(headerProperties);
 }
 
-function AutoComplete(entry) {
-    this._init(entry);
-}
+const AutoComplete = new Lang.Class({
+    Name: 'AutoComplete',
 
-AutoComplete.prototype = {
     _init: function(entry) {
         this._entry = entry;
         this._entry.connect('key-press-event', Lang.bind(this, this._entryKeyPressEvent));
@@ -118,15 +116,13 @@ AutoComplete.prototype = {
 
         this._entry.clutter_text.insert_text(additionalCompletionText, cursorPos);
     }
-};
+});
 Signals.addSignalMethods(AutoComplete.prototype);
 
 
-function Notebook() {
-    this._init();
-}
+const Notebook = new Lang.Class({
+    Name: 'Notebook',
 
-Notebook.prototype = {
     _init: function() {
         this.actor = new St.BoxLayout({ vertical: true });
 
@@ -250,7 +246,7 @@ Notebook.prototype = {
 
         this.selectIndex(prevIndex);
     }
-};
+});
 Signals.addSignalMethods(Notebook.prototype);
 
 function objectToString(o) {
@@ -285,11 +281,9 @@ const ObjLink = new Lang.Class({
     }
 });
 
-function Result(command, o, index) {
-    this._init(command, o, index);
-}
+const Result = new Lang.Class({
+    Name: 'Result',
 
-Result.prototype = {
     _init : function(command, o, index) {
         this.index = index;
         this.o = o;
@@ -311,13 +305,11 @@ Result.prototype = {
         padBin.add_actor(line);
         this.actor.add(padBin);
     }
-};
+});
 
-function WindowList() {
-    this._init();
-}
+const WindowList = new Lang.Class({
+    Name: 'WindowList',
 
-WindowList.prototype = {
     _init : function () {
         this.actor = new St.BoxLayout({ name: 'Windows', vertical: true, style: 'spacing: 8px' });
         let tracker = Shell.WindowTracker.get_default();
@@ -358,14 +350,12 @@ WindowList.prototype = {
             }
         }
     }
-};
+});
 Signals.addSignalMethods(WindowList.prototype);
 
-function ObjInspector() {
-    this._init();
-}
+const ObjInspector = new Lang.Class({
+    Name: 'ObjInspector',
 
-ObjInspector.prototype = {
     _init : function () {
         this._obj = null;
         this._previousObj = null;
@@ -465,7 +455,7 @@ ObjInspector.prototype = {
     _onBack: function() {
         this.selectObject(this._previousObj, true);
     }
-};
+});
 
 function addBorderPaintHook(actor) {
     let signalId = actor.connect_after('paint',
@@ -491,11 +481,9 @@ function addBorderPaintHook(actor) {
     return signalId;
 }
 
-function Inspector() {
-    this._init();
-}
+const Inspector = new Lang.Class({
+    Name: 'Inspector',
 
-Inspector.prototype = {
     _init: function() {
         let container = new Shell.GenericContainer({ width: 0,
                                                      height: 0 });
@@ -634,15 +622,13 @@ Inspector.prototype = {
             this._borderPaintId = addBorderPaintHook(this._target);
         }
     }
-};
+});
 
 Signals.addSignalMethods(Inspector.prototype);
 
-function ErrorLog() {
-    this._init();
-}
+const ErrorLog = new Lang.Class({
+    Name: 'ErrorLog',
 
-ErrorLog.prototype = {
     _init: function() {
         this.actor = new St.BoxLayout();
         this.text = new St.Label();
@@ -677,13 +663,11 @@ ErrorLog.prototype = {
         }
         this.text.text = text;
     }
-};
+});
 
-function Memory() {
-    this._init();
-}
+const Memory = new Lang.Class({
+    Name: 'Memory',
 
-Memory.prototype = {
     _init: function() {
         this.actor = new St.BoxLayout({ vertical: true });
         this._glibc_uordblks = new St.Label();
@@ -728,13 +712,11 @@ Memory.prototype = {
         this._gjs_closure.text = 'gjs_closure: ' + memInfo.gjs_closure;
         this._last_gc_seconds_ago.text = 'last_gc_seconds_ago: ' + memInfo.last_gc_seconds_ago;
     }
-};
+});
 
-function Extensions() {
-    this._init();
-}
+const Extensions = new Lang.Class({
+    Name: 'Extensions',
 
-Extensions.prototype = {
     _init: function() {
         this.actor = new St.BoxLayout({ vertical: true,
                                         name: 'lookingGlassExtensions' });
@@ -864,13 +846,11 @@ Extensions.prototype = {
 
         return box;
     }
-};
+});
 
-function LookingGlass() {
-    this._init();
-}
+const LookingGlass = new Lang.Class({
+    Name: 'LookingGlass',
 
-LookingGlass.prototype = {
     _init : function() {
         this._borderPaintTarget = null;
         this._borderPaintId = 0;
@@ -1227,5 +1207,5 @@ LookingGlass.prototype = {
                                        })
                                      });
     }
-};
+});
 Signals.addSignalMethods(LookingGlass.prototype);
index c42c1462a0457d7e7e28d3878aa66bb738ae10c1..daa02a70f4cdec3f579e7835df1bd77ba10b7725 100644 (file)
@@ -36,11 +36,9 @@ const CROSS_HAIRS_CLIP_KEY      = 'cross-hairs-clip';
 
 let magDBusService = null;
 
-function Magnifier() {
-    this._init();
-}
+const Magnifier = new Lang.Class({
+    Name: 'Magnifier',
 
-Magnifier.prototype = {
     _init: function() {
         // Magnifier is a manager of ZoomRegions.
         this._zoomRegions = [];
@@ -543,14 +541,12 @@ Magnifier.prototype = {
             );
         }
     }
-};
+});
 Signals.addSignalMethods(Magnifier.prototype);
 
-function ZoomRegion(magnifier, mouseSourceActor) {
-    this._init(magnifier, mouseSourceActor);
-}
+const ZoomRegion = new Lang.Class({
+    Name: 'ZoomRegion',
 
-ZoomRegion.prototype = {
     _init: function(magnifier, mouseSourceActor) {
         this._magnifier = magnifier;
 
@@ -1150,13 +1146,11 @@ ZoomRegion.prototype = {
                                                yMagMouse - groupHeight / 2);
         }
     }
-};
+});
 
-function Crosshairs() {
-    this._init();
-}
+const Crosshairs = new Lang.Class({
+    Name: 'Crosshairs',
 
-Crosshairs.prototype = {
     _init: function() {
 
         // Set the group containing the crosshairs to three times the desktop
@@ -1412,4 +1406,4 @@ Crosshairs.prototype = {
         this._vertTopHair.set_position((groupWidth - thickness) / 2, top);
         this._vertBottomHair.set_position((groupWidth - thickness) / 2, bottom);
     }
-};
+});
index 0fdf04b45988850f01c7b0c01bcf93b04c433f11..8204e72e3436191b4e2a7c33b004f8686f71efa5 100644 (file)
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Gio = imports.gi.Gio;
+const Lang = imports.lang;
 const Main = imports.ui.main;
 
 const MAG_SERVICE_NAME = 'org.gnome.Magnifier';
@@ -95,11 +96,9 @@ const ZoomRegionIface = <interface name={ZOOM_SERVICE_NAME}>
 // '/org/gnome/Magnifier/ZoomRegion/zoomer1', etc.
 let _zoomRegionInstanceCount = 0;
 
-function ShellMagnifier() {
-    this._init();
-}
+const ShellMagnifier = new Lang.Class({
+    Name: 'ShellMagnifier',
 
-ShellMagnifier.prototype = {
     _init: function() {
         this._zoomers = {};
 
@@ -325,7 +324,7 @@ ShellMagnifier.prototype = {
         // Drop the leading '#'.
         return parseInt(colorString.slice(1), 16);
      }
-};
+});
 
 /**
  * ShellMagnifierZoomRegion:
@@ -333,11 +332,9 @@ ShellMagnifier.prototype = {
  * @zoomerObjectPath:   String that is the path to a DBus ZoomRegion.
  * @zoomRegion:         The actual zoom region associated with the object path.
  */
-function ShellMagnifierZoomRegion(zoomerObjectPath, zoomRegion) {
-    this._init(zoomerObjectPath, zoomRegion);
-}
+const ShellMagnifierZoomRegion = new Lang.Class({
+    Name: 'ShellMagnifierZoomRegion',
 
-ShellMagnifierZoomRegion.prototype = {
     _init: function(zoomerObjectPath, zoomRegion) {
         this._zoomRegion = zoomRegion;
 
@@ -422,4 +419,4 @@ ShellMagnifierZoomRegion.prototype = {
     destroy: function() {
         this._dbusImpl.unexport();
     }
-};
+});
index e995fc586995d76e192eea009c27b2fd39017ad9..79dbe3d98b583cbf47061fac817f7d70e7dee455 100644 (file)
@@ -83,11 +83,9 @@ function _fixMarkup(text, allowMarkup) {
     return GLib.markup_escape_text(text, -1);
 }
 
-function URLHighlighter(text, lineWrap, allowMarkup) {
-    this._init(text, lineWrap, allowMarkup);
-}
+const URLHighlighter = new Lang.Class({
+    Name: 'URLHighlighter',
 
-URLHighlighter.prototype = {
     _init: function(text, lineWrap, allowMarkup) {
         if (!text)
             text = '';
@@ -211,13 +209,11 @@ URLHighlighter.prototype = {
         }
         return -1;
     }
-};
+});
 
-function FocusGrabber() {
-    this._init();
-}
+const FocusGrabber = new Lang.Class({
+    Name: 'FocusGrabber',
 
-FocusGrabber.prototype = {
     _init: function() {
         this.actor = null;
 
@@ -351,7 +347,7 @@ FocusGrabber.prototype = {
             this._togglingFocusGrabMode = false;
         }
     }
-}
+});
 Signals.addSignalMethods(FocusGrabber.prototype);
 
 // Notification:
@@ -1141,11 +1137,9 @@ const Source = new Lang.Class({
 });
 Signals.addSignalMethods(Source.prototype);
 
-function SummaryItem(source) {
-    this._init(source);
-}
+const SummaryItem = new Lang.Class({
+    Name: 'SummaryItem',
 
-SummaryItem.prototype = {
     _init: function(source) {
         this.source = source;
         this.source.connect('notification-added', Lang.bind(this, this._notificationAddedToSource));
@@ -1336,14 +1330,12 @@ SummaryItem.prototype = {
         if (this.notificationStack.get_children().length > 0)
             this.notificationStack.get_children()[0]._delegate.setIconVisible(true);
     }
-};
+});
 Signals.addSignalMethods(SummaryItem.prototype);
 
-function MessageTray() {
-    this._init();
-}
+const MessageTray = new Lang.Class({
+    Name: 'MessageTray',
 
-MessageTray.prototype = {
     _init: function() {
         this._presence = new GnomeSession.Presence(Lang.bind(this, function(proxy, error) {
             this._onStatusChanged(proxy.status);
@@ -2422,7 +2414,7 @@ MessageTray.prototype = {
         if (this._clickedSummaryItem)
             this._updateState();
     }
-};
+});
 
 const SystemNotificationSource = new Lang.Class({
     Name: 'SystemNotificationSource',
index 276f1403c56b40482fda2d1d0a3e017a1e8762c6..48337dd5e461929467f3bbc52ce77fddc4b0b422 100644 (file)
@@ -357,11 +357,9 @@ const NetworkSecretDialog = new Lang.Class({
     }
 });
 
-function NetworkAgent() {
-    this._init.apply(this, arguments);
-}
+const NetworkAgent = new Lang.Class({
+    Name: 'NetworkAgent',
 
-NetworkAgent.prototype = {
     _init: function() {
         this._native = new Shell.NetworkAgent({ auto_register: true,
                                                 identifier: 'org.gnome.Shell.NetworkAgent' });
@@ -384,4 +382,4 @@ NetworkAgent.prototype = {
         this._dialogs[requestId].close(global.get_current_time());
         this._dialogs[requestId].destroy();
     }
-};
+});
index 6a8ee4ad50fca1d957a33af9e49b5171ddee8a07..52169ce0be0eb252f754f873d80b599ed4f253d3 100644 (file)
@@ -87,11 +87,9 @@ const rewriteRules = {
     ]
 };
 
-function NotificationDaemon() {
-    this._init();
-}
+const NotificationDaemon = new Lang.Class({
+    Name: 'NotificationDaemon',
 
-NotificationDaemon.prototype = {
     _init: function() {
         this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(NotificationDaemonIface, this);
         this._dbusImpl.export(Gio.DBus.session, '/org/freedesktop/Notifications');
@@ -474,7 +472,7 @@ NotificationDaemon.prototype = {
         if (source)
             source.destroy();
     }
-};
+});
 
 const Source = new Lang.Class({
     Name: 'NotificationDaemonSource',
index 567775cfbbc819a0245e16f2679cbc57c07dc3b7..1f66d753116b229b6da9904afad42a3239130196 100644 (file)
@@ -46,11 +46,9 @@ const SwipeScrollResult = {
     CLICK: 2
 };
 
-function ShellInfo() {
-    this._init();
-}
+const ShellInfo = new Lang.Class({
+    Name: 'ShellInfo',
 
-ShellInfo.prototype = {
     _init: function() {
         this._source = null;
         this._undoCallback = null;
@@ -95,13 +93,11 @@ ShellInfo.prototype = {
 
         this._source.notify(notification);
     }
-};
+});
 
-function Overview() {
-    this._init.apply(this, arguments);
-}
+const Overview = new Lang.Class({
+    Name: 'Overview',
 
-Overview.prototype = {
     _init : function(params) {
         params = Params.parse(params, { isDummy: false });
 
@@ -811,5 +807,5 @@ Overview.prototype = {
             this._needsFakePointerEvent = false;
         }
     }
-};
+});
 Signals.addSignalMethods(Overview.prototype);
index db5377611e038f512f2c47a35be0161e6c2eb312..a9344bc761cd92dd2df7a4f7ecf78c758aa42d37 100644 (file)
@@ -98,11 +98,9 @@ function _unpremultiply(color) {
 };
 
 
-function AnimatedIcon(name, size) {
-    this._init(name, size);
-}
+const AnimatedIcon = new Lang.Class({
+    Name: 'AnimatedIcon',
 
-AnimatedIcon.prototype = {
     _init: function(name, size) {
         this.actor = new St.Bin({ visible: false });
         this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
@@ -139,13 +137,11 @@ AnimatedIcon.prototype = {
         if (this._timeoutId)
             Mainloop.source_remove(this._timeoutId);
     }
-};
+});
 
-function TextShadower() {
-    this._init();
-}
+const TextShadower = new Lang.Class({
+    Name: 'TextShadower',
 
-TextShadower.prototype = {
     _init: function() {
         this.actor = new Shell.GenericContainer();
         this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
@@ -225,7 +221,7 @@ TextShadower.prototype = {
             child.allocate(childBox, flags);
         }
     }
-};
+});
 
 /**
  * AppMenuButton:
@@ -692,13 +688,11 @@ const ActivitiesButton = new Lang.Class({
         Mainloop.source_remove(this._xdndTimeOut);
         this._xdndTimeOut = 0;
     }
-})
+});
 
-function PanelCorner(panel, side) {
-    this._init(panel, side);
-}
+const PanelCorner = new Lang.Class({
+    Name: 'PanelCorner',
 
-PanelCorner.prototype = {
     _init: function(box, side) {
         this._side = side;
 
@@ -874,14 +868,12 @@ PanelCorner.prototype = {
         this.actor.set_size(cornerRadius, innerBorderWidth + cornerRadius);
         this.actor.set_anchor_point(0, innerBorderWidth);
     }
-};
+});
 
 
-function Panel() {
-    this._init();
-}
+const Panel = new Lang.Class({
+    Name: 'Panel',
 
-Panel.prototype = {
     _init : function() {
         this.actor = new Shell.GenericContainer({ name: 'panel',
                                                   reactive: true });
@@ -1108,5 +1100,4 @@ Panel.prototype = {
         if (box && box._delegate instanceof PanelMenu.ButtonBox)
             box.destroy();
     },
-
-};
+});
index e8cec716486e3443f427cbb1c490ed2e0f5f1e25..9241ebf56d5028ea7f95e177190c64ca56a67767 100644 (file)
@@ -120,11 +120,9 @@ const PlaceDeviceInfo = new Lang.Class({
     }
 });
 
-function PlacesManager() {
-    this._init();
-}
+const PlacesManager = new Lang.Class({
+    Name: 'PlacesManager',
 
-PlacesManager.prototype = {
     _init: function() {
         this._defaultPlaces = [];
         this._mounts = [];
@@ -355,7 +353,7 @@ PlacesManager.prototype = {
     _removeById: function(sourceArray, id) {
         sourceArray.splice(this._lookupIndexById(sourceArray, id), 1);
     }
-};
+});
 Signals.addSignalMethods(PlacesManager.prototype);
 
 const PlaceSearchProvider = new Lang.Class({
index 7fe03105bec4278c39bce93a0cccacd8ad554718..ff2d35c089adb44d423c13304093d5cfa7fc76d3 100644 (file)
@@ -335,11 +335,9 @@ const AuthenticationDialog = new Lang.Class({
 });
 Signals.addSignalMethods(AuthenticationDialog.prototype);
 
-function AuthenticationAgent() {
-    this._init();
-}
+const AuthenticationAgent = new Lang.Class({
+    Name: 'AuthenticationAgent',
 
-AuthenticationAgent.prototype = {
     _init: function() {
         this._native = new Shell.PolkitAuthenticationAgent();
         this._native.connect('initiate', Lang.bind(this, this._onInitiate));
@@ -400,7 +398,7 @@ AuthenticationAgent.prototype = {
             this._reallyCompleteRequest(wasDismissed);
         }
     }
-}
+});
 
 function init() {
     let agent = new AuthenticationAgent();
index a8d3384f6cd7bf2689d5384f33410c44d25d407a..5652fc4acc2dd419d6280155cd1de276a2ca8303 100644 (file)
@@ -771,7 +771,7 @@ const PopupSwitchMenuItem = new Lang.Class({
             this.toggle();
         }
 
-        PopupBaseMenuItem.prototype.activate.call(this, event);
+        this.parent(event);
     },
 
     toggle: function() {
index eed47668481deeec8721991b06b10a9836183859..69a0c26c803c315a4ca3c2702fce2f9913550a17 100644 (file)
@@ -30,11 +30,9 @@ const EXEC_ARG_KEY = 'exec-arg';
 
 const DIALOG_GROW_TIME = 0.1;
 
-function CommandCompleter() {
-    this._init();
-}
+const CommandCompleter = new Lang.Class({
+    Name: 'CommandCompleter',
 
-CommandCompleter.prototype = {
     _init : function() {
         this._changedCount = 0;
         this._paths = GLib.getenv('PATH').split(':');
@@ -162,7 +160,7 @@ CommandCompleter.prototype = {
             return common.substr(text.length);
         return common;
     }
-};
+});
 
 const RunDialog = new Lang.Class({
     Name: 'RunDialog',
index 12a12e59d4e181d805fb5dd4cd755d7a6747f691..52cd7a86a2dad8f7f0cb23f3adb531a901c6fab8 100644 (file)
@@ -242,11 +242,9 @@ const SearchProvider = new Lang.Class({
 });
 Signals.addSignalMethods(SearchProvider.prototype);
 
-function OpenSearchSystem() {
-    this._init();
-}
+const OpenSearchSystem = new Lang.Class({
+    Name: 'OpenSearchSystem',
 
-OpenSearchSystem.prototype = {
     _init: function() {
         this._providers = [];
         global.settings.connect('changed::' + DISABLED_OPEN_SEARCH_PROVIDERS_KEY, Lang.bind(this, this._refresh));
@@ -334,14 +332,12 @@ OpenSearchSystem.prototype = {
             }
         }));
     }
-}
+});
 Signals.addSignalMethods(OpenSearchSystem.prototype);
 
-function SearchSystem() {
-    this._init();
-}
+const SearchSystem = new Lang.Class({
+    Name: 'SearchSystem',
 
-SearchSystem.prototype = {
     _init: function() {
         this._providers = [];
         this.reset();
@@ -429,5 +425,5 @@ SearchSystem.prototype = {
         this._previousResults = results;
         this.emit('search-completed', results);
     },
-};
+});
 Signals.addSignalMethods(SearchSystem.prototype);
index bd551e150c98d046cc641259ccfbdbdf38f8fb37..57478b76fe4ee6ef03bc461441a2cc545afe85c1 100644 (file)
@@ -15,11 +15,9 @@ const Search = imports.ui.search;
 const MAX_SEARCH_RESULTS_ROWS = 1;
 
 
-function SearchResult(provider, metaInfo, terms) {
-    this._init(provider, metaInfo, terms);
-}
+const SearchResult = new Lang.Class({
+    Name: 'SearchResult',
 
-SearchResult.prototype = {
     _init: function(provider, metaInfo, terms) {
         this.provider = provider;
         this.metaInfo = metaInfo;
@@ -97,7 +95,7 @@ SearchResult.prototype = {
         else
             this.provider.activateResult(this.metaInfo.id, params);
     }
-};
+});
 
 
 const GridSearchResults = new Lang.Class({
@@ -179,11 +177,9 @@ const GridSearchResults = new Lang.Class({
     }
 });
 
-function SearchResults(searchSystem, openSearchSystem) {
-    this._init(searchSystem, openSearchSystem);
-}
+const SearchResults = new Lang.Class({
+    Name: 'SearchResults',
 
-SearchResults.prototype = {
     _init: function(searchSystem, openSearchSystem) {
         this._searchSystem = searchSystem;
         this._searchSystem.connect('search-updated', Lang.bind(this, this._updateCurrentResults));
@@ -483,4 +479,4 @@ SearchResults.prototype = {
         resultDisplay.activateSelected();
         Main.overview.hide();
     }
-};
+});
index 6a0a827314dc4812b6838f9404fee5dae5de8b13..9dd8bccef040a922ab76dee222c8042405eb678a 100644 (file)
@@ -66,11 +66,9 @@ const GnomeShellIface = <interface name="org.gnome.Shell">
 </signal>
 </interface>;
 
-function GnomeShell() {
-    this._init();
-}
+const GnomeShell = new Lang.Class({
+    Name: 'GnomeShellDBus',
 
-GnomeShell.prototype = {
     _init: function() {
         this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellIface, this);
         this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell');
@@ -230,4 +228,4 @@ GnomeShell.prototype = {
         this._dbusImpl.emit_signal('ExtensionStatusChanged',
                                    GLib.Variant.new('(sis)', [newState.uuid, newState.state, newState.error]));
     }
-};
+});
index ba5f45e41f855927ec6ef8078a22765c998c9b2f..0fd149e3cbcb69c078ca5e8b309d3a510b1a0c24 100644 (file)
@@ -50,11 +50,9 @@ function _setLabelsForMessage(dialog, message) {
 
 /* -------------------------------------------------------- */
 
-function ListItem(app) {
-    this._init(app);
-}
+const ListItem = new Lang.Class({
+    Name: 'ListItem',
 
-ListItem.prototype = {
     _init: function(app) {
         this._app = app;
 
@@ -86,14 +84,12 @@ ListItem.prototype = {
         this.emit('activate');
         this._app.activate();
     }
-};
+});
 Signals.addSignalMethods(ListItem.prototype);
 
-function ShellMountOperation(source, params) {
-    this._init(source, params);
-}
+const ShellMountOperation = new Lang.Class({
+    Name: 'ShellMountOperation',
 
-ShellMountOperation.prototype = {
     _init: function(source, params) {
         params = Params.parse(params, { reaskPassword: false });
 
@@ -190,7 +186,7 @@ ShellMountOperation.prototype = {
 
         this._processesDialog.update(message, processes, choices);
     },
-}
+});
 
 const ShellMountQuestionDialog = new Lang.Class({
     Name: 'ShellMountQuestionDialog',
index 7efa2e227182ae2efd16c020de42b0a777c7612f..b95c8e3a320e84a04bf174305d316714f631500c 100644 (file)
@@ -353,7 +353,7 @@ const Source = new Lang.Class({
             }
         }));
 
-        MessageTray.Source.prototype.notify.call(this, notification);
+        this.parent(notification);
     },
 
     createNotificationIcon: function() {
@@ -485,7 +485,7 @@ const PinNotification = new Lang.Class({
     },
 
     grabFocus: function(lockTray) {
-        MessageTray.Notification.prototype.grabFocus.call(this, lockTray);
+        this.parent(lockTray);
         global.stage.set_key_focus(this._entry);
     }
 });
index 33bd47bb77896877dd7652eb999f33586da5bf4b..d168d6d8163af732f38aa4b04184022ae66db736 100644 (file)
@@ -23,11 +23,9 @@ const STANDARD_TRAY_ICON_IMPLEMENTATIONS = {
     'ibus-ui-gtk': 'input-method'
 };
 
-function StatusIconDispatcher() {
-    this._init();
-}
+const StatusIconDispatcher = new Lang.Class({
+    Name: 'StatusIconDispatcher',
 
-StatusIconDispatcher.prototype = {
     _init: function() {
         this._traymanager = new Shell.TrayManager();
         this._traymanager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded));
@@ -61,5 +59,5 @@ StatusIconDispatcher.prototype = {
         else
             this.emit('message-icon-removed', icon);
     }
-};
+});
 Signals.addSignalMethods(StatusIconDispatcher.prototype);
index 6d717fcfabc50a6843371d87e4a88419ec53ff49..08d6c8c44f8478fbbb52736b45b6a7ab34834b2d 100644 (file)
@@ -72,11 +72,9 @@ function makeMessageFromTplEvent(event) {
     };
 }
 
-function Client() {
-    this._init();
-};
+const Client = new Lang.Class({
+    Name: 'Client',
 
-Client.prototype = {
     _init : function() {
         // channel path -> ChatSource
         this._chatSources = {};
@@ -479,7 +477,7 @@ Client.prototype = {
 
         return this._accountSource;
     }
-};
+});
 
 const ChatSource = new Lang.Class({
     Name: 'ChatSource',
@@ -694,7 +692,7 @@ const ChatSource = new Lang.Class({
     },
 
     notify: function() {
-        MessageTray.Source.prototype.notify.call(this, this._notification);
+        this.parent(this._notification);
     },
 
     respond: function(text) {
@@ -1113,7 +1111,7 @@ const ApproverSource = new Lang.Class({
             this._invalidId = 0;
         }
 
-        MessageTray.Source.prototype.destroy.call(this);
+        this.parent();
     },
 
     createNotificationIcon: function() {
index d68d666070301b535f91f27e7b8dab3ec23eed6c..7d98a65b37fabfce1475ab839a800a5a70e7a038 100644 (file)
@@ -202,11 +202,9 @@ function registerSpecialPropertySplitter(name, splitFunction, parameters) {
 // time updates; even better is to pay attention to the vertical
 // vblank and sync to that when possible.)
 //
-function ClutterFrameTicker() {
-    this._init();
-}
+const ClutterFrameTicker = new Lang.Class({
+    Name: 'ClutterFrameTicker',
 
-ClutterFrameTicker.prototype = {
     FRAME_RATE : 60,
 
     _init : function() {
@@ -261,6 +259,6 @@ ClutterFrameTicker.prototype = {
         this._startTime = -1;
         global.end_work();
     }
-};
+});
 
 Signals.addSignalMethods(ClutterFrameTicker.prototype);
index dd70ca308bc6a66f5f4c0394191463302651fe5a..f7bf491c27045882589f4d2dbbbbcdb60e723d05 100644 (file)
@@ -301,11 +301,9 @@ const SearchTab = new Lang.Class({
 });
 
 
-function ViewSelector() {
-    this._init();
-}
+const ViewSelector = new Lang.Class({
+    Name: 'ViewSelector',
 
-ViewSelector.prototype = {
     _init : function() {
         this.actor = new St.BoxLayout({ name: 'viewSelector',
                                         vertical: true });
@@ -565,5 +563,5 @@ ViewSelector.prototype = {
     removeSearchProvider: function(provider) {
         this._searchTab.removeSearchProvider(provider);
     }
-};
+});
 Signals.addSignalMethods(ViewSelector.prototype);
index af31bdd1c887741838ddd740285fed33665507ec..3c946ad2b1b59569956b4e2fe34bd472e6894efc 100644 (file)
@@ -6,11 +6,9 @@ const Shell = imports.gi.Shell;
 const Main = imports.ui.main;
 const MessageTray = imports.ui.messageTray;
 
-function WindowAttentionHandler() {
-    this._init();
-}
+const WindowAttentionHandler = new Lang.Class({
+    Name: 'WindowAttentionHandler',
 
-WindowAttentionHandler.prototype = {
     _init : function() {
         this._tracker = Shell.WindowTracker.get_default();
         global.display.connect('window-demands-attention', Lang.bind(this, this._onWindowDemandsAttention));
@@ -43,7 +41,7 @@ WindowAttentionHandler.prototype = {
                                                  notification.update(title, banner);
                                              })));
     }
-};
+});
 
 const Source = new Lang.Class({
     Name: 'WindowAttentionSource',
index 4343a2012a70db8be033577f885a598a11aa1e5b..637d842eabd8cbb3294fa71338c0292513c4ffa5 100644 (file)
@@ -31,11 +31,9 @@ function getTopInvisibleBorder(metaWindow) {
     return outerRect.y - inputRect.y;
 }
 
-function WindowDimmer(actor) {
-    this._init(actor);
-}
+const WindowDimmer = new Lang.Class({
+    Name: 'WindowDimmer',
 
-WindowDimmer.prototype = {
     _init: function(actor) {
         if (Clutter.feature_available(Clutter.FeatureFlags.SHADERS_GLSL)) {
             this._effect = new Clutter.ShaderEffect({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER });
@@ -75,7 +73,7 @@ WindowDimmer.prototype = {
     },
 
     _dimFraction: 0.0
-};
+});
 
 function getWindowDimmer(actor) {
     if (!actor._windowDimmer)
@@ -84,11 +82,9 @@ function getWindowDimmer(actor) {
     return actor._windowDimmer;
 }
 
-function WindowManager() {
-    this._init();
-}
+const WindowManager = new Lang.Class({
+    Name: 'WindowManager',
 
-WindowManager.prototype = {
     _init : function() {
         this._shellwm =  global.window_manager;
 
@@ -627,4 +623,4 @@ WindowManager.prototype = {
         if (!Main.overview.visible)
             this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.DOWN, indexToActivate);
     }
-};
+});
index 97b0893a7be06f49d92a61f7a821888e5f2ae076..d7b61dfecc21d5f9889482f1e908f30bdfd2b35d 100644 (file)
@@ -56,11 +56,13 @@ function _clamp(value, min, max) {
 }
 
 
-function ScaledPoint(x, y, scaleX, scaleY) {
-    [this.x, this.y, this.scaleX, this.scaleY] = arguments;
-}
+const ScaledPoint = new Lang.Class({
+    Name: 'ScaledPoint',
+
+    _init: function(x, y, scaleX, scaleY) {
+        [this.x, this.y, this.scaleX, this.scaleY] = arguments;
+    },
 
-ScaledPoint.prototype = {
     getPosition : function() {
         return [this.x, this.y];
     },
@@ -86,14 +88,12 @@ ScaledPoint.prototype = {
         return [_interpolate(this.scaleX, other.scaleX, step),
                 _interpolate(this.scaleY, other.scaleY, step)];
     }
-};
+});
 
 
-function WindowClone(realWindow) {
-    this._init(realWindow);
-}
+const WindowClone = new Lang.Class({
+    Name: 'WindowClone',
 
-WindowClone.prototype = {
     _init : function(realWindow) {
         this.realWindow = realWindow;
         this.metaWindow = realWindow.meta_window;
@@ -418,7 +418,7 @@ WindowClone.prototype = {
 
         this.emit('drag-end');
     }
-};
+});
 Signals.addSignalMethods(WindowClone.prototype);
 
 
@@ -427,11 +427,9 @@ Signals.addSignalMethods(WindowClone.prototype);
  * @parentActor: The actor which will be the parent of all overlay items
  *               such as app icon and window caption
  */
-function WindowOverlay(windowClone, parentActor) {
-    this._init(windowClone, parentActor);
-}
+const WindowOverlay = new Lang.Class({
+    Name: 'WindowOverlay',
 
-WindowOverlay.prototype = {
     _init : function(windowClone, parentActor) {
         let metaWindow = windowClone.metaWindow;
 
@@ -642,7 +640,7 @@ WindowOverlay.prototype = {
 
         this._parentActor.queue_relayout();
     }
-};
+});
 Signals.addSignalMethods(WindowOverlay.prototype);
 
 const WindowPositionFlags = {
@@ -653,11 +651,9 @@ const WindowPositionFlags = {
 /**
  * @metaWorkspace: a #Meta.Workspace, or null
  */
-function Workspace(metaWorkspace, monitorIndex) {
-    this._init(metaWorkspace, monitorIndex);
-}
+const Workspace = new Lang.Class({
+    Name: 'Workspace',
 
-Workspace.prototype = {
     _init : function(metaWorkspace, monitorIndex) {
         // When dragging a window, we use this slot for reserve space.
         this._reservedSlot = null;
@@ -1518,6 +1514,6 @@ Workspace.prototype = {
 
         return false;
     }
-};
+});
 
 Signals.addSignalMethods(Workspace.prototype);
index a4883d459174abb00803df937ca10ede1e132d6d..58dd657a80a95d7da0f0bf04e07a93d4df93d37c 100644 (file)
@@ -15,11 +15,9 @@ const DISPLAY_TIMEOUT = 600;
 const UP = -1;
 const DOWN = 1;
 
-function WorkspaceSwitcherPopup() {
-    this._init();
-}
+const WorkspaceSwitcherPopup = new Lang.Class({
+    Name: 'WorkspaceSwitcherPopup',
 
-WorkspaceSwitcherPopup.prototype = {
     _init : function() {
         this.actor = new St.Group({ reactive: true,
                                          x: 0,
@@ -158,4 +156,4 @@ WorkspaceSwitcherPopup.prototype = {
                                             onCompleteScope: this
                                            });
     }
-};
+});
index 504d32bc3e6a53cf658e81bec1b814442aeab875..33059900af60cf1f68b807cbb6343a31e7d7ae6e 100644 (file)
@@ -25,11 +25,9 @@ const SLIDE_ANIMATION_TIME = 0.2;
 // placeholder exactly.
 const WORKSPACE_CUT_SIZE = 10;
 
-function WindowClone(realWindow) {
-    this._init(realWindow);
-}
+const WindowClone = new Lang.Class({
+    Name: 'WindowClone',
 
-WindowClone.prototype = {
     _init : function(realWindow) {
         this.actor = new Clutter.Clone({ source: realWindow.get_texture(),
                                          reactive: true });
@@ -126,7 +124,7 @@ WindowClone.prototype = {
 
         this.emit('drag-end');
     }
-};
+});
 Signals.addSignalMethods(WindowClone.prototype);
 
 
@@ -144,11 +142,9 @@ const ThumbnailState = {
 /**
  * @metaWorkspace: a #Meta.Workspace
  */
-function WorkspaceThumbnail(metaWorkspace) {
-    this._init(metaWorkspace);
-}
+const WorkspaceThumbnail = new Lang.Class({
+    Name: 'WorkspaceThumbnail',
 
-WorkspaceThumbnail.prototype = {
     _init : function(metaWorkspace) {
         this.metaWorkspace = metaWorkspace;
         this.monitorIndex = Main.layoutManager.primaryIndex;
@@ -469,16 +465,14 @@ WorkspaceThumbnail.prototype = {
 
         return false;
     }
-};
+});
 
 Signals.addSignalMethods(WorkspaceThumbnail.prototype);
 
 
-function ThumbnailsBox() {
-    this._init();
-}
+const ThumbnailsBox = new Lang.Class({
+    Name: 'ThumbnailsBox',
 
-ThumbnailsBox.prototype = {
     _init: function() {
         this.actor = new Shell.GenericContainer({ style_class: 'workspace-thumbnails',
                                                   request_mode: Clutter.RequestMode.WIDTH_FOR_HEIGHT });
@@ -1028,4 +1022,4 @@ ThumbnailsBox.prototype = {
                            onCompleteScope: this
                          });
     }
-};
+});
index d99488539af87583dcee53da3cd77dddb86726eb..fb45e217aa46a8c34540d345a0019ac7b20e88dc 100644 (file)
@@ -23,11 +23,9 @@ const MAX_WORKSPACES = 16;
 const CONTROLS_POP_IN_TIME = 0.1;
 
 
-function WorkspacesView(workspaces) {
-    this._init(workspaces);
-}
+const WorkspacesView = new Lang.Class({
+    Name: 'WorkspacesView',
 
-WorkspacesView.prototype = {
     _init: function(workspaces) {
         this.actor = new St.Group({ style_class: 'workspaces-view' });
 
@@ -452,15 +450,13 @@ WorkspacesView.prototype = {
     _getWorkspaceIndexToRemove: function() {
         return global.screen.get_active_workspace_index();
     }
-};
+});
 Signals.addSignalMethods(WorkspacesView.prototype);
 
 
-function WorkspacesDisplay() {
-    this._init();
-}
+const WorkspacesDisplay = new Lang.Class({
+    Name: 'WorkspacesDisplay',
 
-WorkspacesDisplay.prototype = {
     _init: function() {
         this.actor = new Shell.GenericContainer();
         this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
@@ -852,5 +848,5 @@ WorkspacesDisplay.prototype = {
             break;
         }
     }
-};
+});
 Signals.addSignalMethods(WorkspacesDisplay.prototype);
index 08f0b47f8bf7416b13c8486cde6ce3a5ed3187b2..26f54322c29a3b97ada5706d36db726ba5e4ed91 100644 (file)
@@ -6,11 +6,9 @@ const Shell = imports.gi.Shell;
 const Signals = imports.signals;
 const DND = imports.ui.dnd;
 
-function XdndHandler() {
-    this._init();
-}
+const XdndHandler = new Lang.Class({
+    Name: 'XdndHandler',
 
-XdndHandler.prototype = {
     _init: function() {
         // Used to display a clone of the cursor window when the
         // window group is hidden (like it happens in the overview)
@@ -125,6 +123,6 @@ XdndHandler.prototype = {
                 pickedActor = pickedActor.get_parent();
         }
     }
-}
+});
 
 Signals.addSignalMethods(XdndHandler.prototype);